<?php
namespace App\Services\Models;

class Orders extends \Eloquent{

    const shop_id = 100332;

    const status_default  = 1;
    const status_reported = 2;
    const customs_status_text = [
        '准备申报',
        '电子口岸申报中',
        '发送海关成功',
        '发送海关失败',
        '海关退单',
        '海关入库',
        '处理异常，请稍后重试',
    ];
 /**
     * The database used by the model.
     *
     * @var string
     */
    protected $table = 'orders';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $guarded = [''];
    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = [''];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'report_response'   => 'object'
    ];

    public function __construct(array $attributes = []){
        parent::__construct($attributes);
    }

    public static function findOrderByTid($tid){
        return self::where('tid',$tid)->first();
    }

}